#include "Mesh.h"
Mesh::Mesh () {}

Mesh::Mesh (Mesh &m)
{
	triangs = m.get_triangs ();
	verts = m.get_verts ();
}

Mesh::~Mesh ()
{
	for (vector<Triangle *>::iterator it = triangs.begin (); it != triangs.end (); it++)
		delete *it;
}

vector<Triangle *> 
Mesh::get_triangs ()
{
	return triangs;
}

vector<Vertex3D *> 
Mesh::get_verts ()
{
	return verts;
}

void 
Mesh::add_vertex (Vertex3D *v)
{
	verts.push_back (v);
}

void
Mesh::add_triangle (Triangle *t)
{
	triangs.push_back (t);
	/* TODO : add vertex to the list of vertex
 * if the arent there yet */
}

Triangle *
Mesh::get_triangle (GLuint n)
{
	return triangs.at (n);
}
 
Vertex3D *
Mesh::get_vertex (GLuint n)
{
	return verts.at (n);
}
 
Vertex3D Mesh::get_com()
{
	return com;
}

void
Mesh :: set_state(TState s)
{
	state = s;
}

TState
Mesh :: get_state()
{
	return state;
}
